home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / GLX / cutNpaste / Motif+Xt / data.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  57 lines

  1. /*
  2.  * Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #define ELEMNAMESIZE    4
  18. #define MOLNAMESIZE    80
  19.  
  20.  
  21. #define MAX(a,b) ((a)>(b)?(a):(b))
  22. #define MIN(a,b) ((a)<(b)?(a):(b))
  23.  
  24. typedef struct element {
  25.     char name[ELEMNAMESIZE];
  26.     float radius;
  27.     long color;
  28.     struct element *next;
  29. };
  30.  
  31. typedef struct atom {
  32.     struct element *e;
  33.     float xyz[3];
  34.     struct atom *next;
  35. };
  36.  
  37. typedef struct molecule {
  38.     char name[MOLNAMESIZE];
  39.     float min[3];
  40.     float max[3];
  41.     struct atom* atoms;
  42.     struct molecule *next;
  43. };
  44.  
  45. extern struct element *elementRoot;
  46. extern struct molecule *moleculeRoot;
  47.  
  48. extern struct atom *freeAtoms(struct atom *p);
  49. extern struct molecule *freeMolecules(struct molecule *p);
  50. extern struct element *freeElements(struct element *p);
  51. extern struct element *createElement(struct element *p, char *name, 
  52.         float radius, float red, float green, float blue);
  53. extern struct molecule *createMolecule(struct molecule *p, char *name);
  54. extern struct element *findElement(struct element *p, char *name);
  55. extern struct atom *createAtom(struct atom *p, struct element *e, float x, float y, float z);
  56. extern void addAtom(struct molecule *p, char *name, float x, float y, float z);
  57.